package com.yuexi.bill.cqe;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.Valid;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Positive;
import java.math.BigDecimal;
import java.util.List;

/**
 * @author jie
 * @date 2023/4/6 -16:08
 */
@Data
public class PayBillCmd {

    @ApiModelProperty(hidden = true)
    private String userId;

    private String authCode;

    @NotEmpty(message = "不支持的支付方式")
    private String payBy;

    @NotNull(message = "请输入桌台金额")
    @ApiModelProperty(value = "原价", required = true)
    private BigDecimal originalPrice;

    @Positive(message = "应收金额不能为0")
    @NotNull(message = "参数错误（应收）")
    @ApiModelProperty(value = "应收", required = true)
    private BigDecimal receivable;

    @NotNull(message = "请输入收款金额")
    @ApiModelProperty(value = "实付", required = true)
    private BigDecimal actuallyPaid;

    private BigDecimal giveChange;

    private BigDecimal discount;

    @Valid
    @NotEmpty(message = "参数错误（桌台）")
    private List<PayBillDetailCmd> details;
}
